package com.shidaimanong.demo.file;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class FileWriterDemo {

    public static void main(String[] args) {
        BufferedWriter out = null;
        try {
            out = new BufferedWriter(new FileWriter("离婚协议书.txt"));
            out.write("今天我和自家的狗，离了");
            out.close();
        } catch (IOException e) {
            System.out.print(e.getMessage());
        } finally {
            try {
                out.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}